Output driver circuit with current detection

ABSTRACT

The present invention provides an output driver circuit that can be used to determine whether a repeater buffer is the only device driving a bus low. According to the invention, the current through the output driver circuit of the repeater buffer is compared with a reference current. If that current is greater than the reference current, then the output driver circuit (i.e., the repeater buffer) is the only output driving the bus low. On the other hand, if that current is less than the reference current, then the output driver circuit (and thus the repeater buffer) is not the only device driving the bus low. This information can be used in an I 2 C repeater to determine the proper response of the repeater and prevent a latch condition.

BACKGROUND OF THE INVENTION

[0001] This invention relates to the field of electronics, and in particular to a device that facilitates the interconnection of devices using an I²C interface.

[0002] The Inter Integrated Circuit (I²C) bus is an industry standard bus interface developed by Philips Corporation, which allows integrated circuits to communicate directly with each other via a simple bi-directional 2-wire bus. Interfacing devices in an I²C based system can be achieved by directly connecting them to the two bus lines: a serial data line (SDA) for the communication of data, and a serial clock line (SCL) for the control and synchronization of the communication of data between the devices.

[0003]FIG. 1 shows a block diagram of an I²C repeater 1 having one channel (SDA or SCL). In a typical I²C bus, another identical circuit as that in FIG. 1 is used for the other channel (SCL or SDA as the case may be). Repeater 1 is a device that allows separation of two I²C bus segments, segments A and B, by electrically isolating the two segments and repeating signals from one segment to the other. Each segment is of a wired-OR type. All devices on the bus are open-collector/open-drain devices and are only capable of driving the bus to a low state (about 0 volts). An external pull-up resistor pulls the bus high (about Vdd) when no device is driving it low. A main drawback with this type of repeater is that it can latch into a low state. For example, if segment A is driven low, repeater 1 will drive segment B low through buffer 10. This low on segment B caused by buffer 10 must not cause buffer 20 to drive segment A low; otherwise a latch condition will occur. Also, buffer 20 cannot be turned off because any device on segment B can drive segment B low, in which case buffer 20 must drive segment A low.

[0004] Therefore, there is a need for a scheme that can effectively determine whether a repeater buffer, e.g., buffer 10, is the only device driving a bus low, so as to prevent any latch condition.

SUMMARY OF THE INVENTION

[0005] The present invention provides an output driver circuit that can be used to determine whether a repeater buffer is the only device driving a bus low. According to the invention, the current through the output driver circuit is compared with a reference current. If that current is greater than the reference current, then the output driver circuit (and hence the repeater buffer) is the only output driving the bus low. On the other hand, if that current is less than the reference current, then the output driver circuit is not the only device driving the bus low. This information can be used in an I²C repeater to determine the proper response of the repeater and prevent a latch condition.

[0006] According to a first embodiment of the present invention, an output driver circuit for connecting to a bus is provided. The circuit comprises a first output driver connected to the bus; a second output driver for generating a reference current; and a comparator, connected to the first and second output drivers, for comparing current flowing through the first output driver with the reference current to determine whether there is an external device driving the bus.

[0007] According to one aspect of the first embodiment of the invention, the first output driver includes a first resistor and a first transistor, and the second output driver includes a second resistor and a second transistor.

[0008] According to another aspect of the first embodiment of the invention, the first resistor is slightly larger than the second resistor in value and the first and second transistor are substantially identical.

[0009] According to a second embodiment of the invention, an output driver circuit for connecting to a bus is provided. The circuit comprises a parallel circuit including first is and second paths, the first path for connecting to the bus; a transistor connected to the parallel circuit in series; and a comparator, connected to first and second paths, for comparing currents flowing through the two paths to determine whether there is an external device driving the bus.

[0010] According to one aspect of the second embodiment of the invention, the first path includes first and second resistors, and the second path includes third and fourth resistors.

[0011] According to another aspect of the second embodiment of the invention, the first path is a low impedance path, and the second path is a high impedance path. Furthermore, the first, second, third and fourth resistors are scaled such that, when there are no external devices driving the bus, the comparator detects a predetermined difference between the currents flowing through the two paths.

[0012] Other objects and attainments together with a fuller understanding of the invention will become apparent and appreciated by referring to the following description and claims taken in conjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The invention is explained in further detail, and by way of example, with reference to the accompanying drawings wherein:

[0014]FIG. 1 shows a block diagram of a standard 12C repeater having one channel;

[0015]FIG. 2 illustrates an output driver circuit according to a first embodiment of the present invention;

[0016]FIG. 3 shows the output driver circuit of FIG. 2 along with an additional device;

[0017]FIG. 4 illustrates an output driver circuit according to a second embodiment of the present invention; and

[0018]FIG. 5 shows the output driver circuit of FIG. 4 along with an additional device.

[0019] Throughout the drawings, the same reference numerals indicate similar or corresponding features or functions.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0020]FIG. 2 illustrates an output driver circuit 30 according to a first embodiment of the present invention. Circuit 30 is the output stage of a buffer (e.g., buffer 10 or 20 in FIG. 1). For example, in the case of buffer 20, VoutA corresponds to the voltage at bus segment A in FIG. 1. In the case of buffer 10, VoutA corresponds to the voltage at bus segment B in FIG. 1.

[0021] In FIG. 2, circuit 30 comprises an output driver 32, a replica driver 34, and a comparator 36 in the form of an op-amp, for example. Output driver 32 includes a drain resistor R1 and an NMOS transistor Q1. Replica driver 34 includes a drain resistor R2 40 slightly less than RI and an NMOS transistor Q2 identical to Q1. Replica output driver 34 is used for generating a reference current, as will be discussed below.

[0022] When the gate voltage (at node gt1) of transistors Q1 and Q2 goes high, both the transistors will turn on and pull their outputs low. As the output goes low, the drain-source voltage of each transistor becomes less than the gate-source voltage and will enter into the linear region of operation, thus behaving like a resistor. Since the transistors Q1 and Q2 are identical and have identical gate-source voltages they will tend to have identical behavior and identical resistance values. This resistor behavior improves as the drain-source voltage decreases. Therefore, the current through transistors Q1 and Q2 will be identical if they have identical loads, assuming that the resistance values of the two transistors are identical. Loads for the transistor Q1 are R1 and R×1 while the loads for transistor Q2 are R2 and R×2. Load resistors R×1 and R×2 are chosen to be identical. By selecting R2<R1, a slightly different current will flow through transistors Q1 and Q2. This current difference is measured as a voltage difference across resistors R1 to ground and R2 to ground. When output driver circuit 30 is the only device driving the bus low, the voltage VoutA seen at R1 will be greater than the voltage VsamA at R2. This voltage difference is detected by comparator 36. Thus, when node gt1 goes high, the output of comparator 36 also goes high, indicating that output driver circuit 30 (i.e., the buffer) is the only output device driving the bus.

[0023] If the output driver circuit 30 is not the only device driving the bus low because of an additional device 50 as illustrated in FIG. 3, less current will flow through R1 and the voltage seen VoutA at R1 will be less than the voltage VsamA at R2. This voltage difference is also detected by comparator 36. The change in voltage at R1 due to current sharing on the bus is used to determine if output driver circuit 30 (and thus the repeater buffer) is the only device driving the bus. Thus, in FIG. 3, when node gt1 goes high while node gt3 is still low, it indicates that output driver circuit 30 (i.e., the buffer) is the only device driving the bus low and the output of comparator 36 is high. When nodes gt1 and gt3 both go high, it indicates that there is an additional device 50 driving the bus low, and the output of comparator 36 goes low.

[0024]FIG. 4 shows an output driver circuit 60 according to a second embodiment of the present invention. Like circuit 30, circuit 60 is the output stage of a buffer (e.g., buffer 10 or 20 in FIG. 1). Similarly, in the case of buffer 20, VoutA1 corresponds to the voltage at bus segment A in FIG. 1. In the case of buffer 10, VoutA1 corresponds to the voltage at bus segment B.

[0025] In FIG. 4, circuit 60 comprises a parallel circuit 62, an NMOS transistor Q4 and a comparator 66. Parallel circuit 62 includes two paths: path 1 and path 2. The current through output transistor Q4 is divided between the two paths. The currents through these paths are compared in the form of voltage drops by comparator 66 to determine if output driver circuit 60 (i.e., the buffer) is the only device pulling the bus (i.e., VoutA1) low. When transistor Q4 is ON, the drain current of Q4 is the sum of the currents through the two paths. Path 1 is a low impedance path including resistors R1 a and R1 b. Path 2 is a high impedance path including resistors R2 a and R2 b. In a specific example, R1 a and R1 b each have a value of 20 ohms, and R2 a and R2 b each have a value of 10 kohms. The resistors in path 2 need not be equal in value to create a fixed voltage offset for comparator 66. In this fashion, when output drive transistor Q4 is ON and output driver circuit 60 (i.e., the buffer) is the only device driving the bus low, the current through R1 a is equal to the current through R1 b and a voltage level VsamA1 at R1 a is set. Since the current through R2 a always equals the current through R2 b, these two resistors can be scaled such that the voltage VsamA1 at R2 a is lower than the voltage at R1 a VoutA1. Thus, when node gt4 goes high, the output of comparator 66 goes high, indicating that output driver circuit 60 (i.e., the buffer) is the only output device driving the bus.

[0026] When another device 80 is also driving the bus low as shown in FIG. 5, the current through R1 b is greater than the current through R1 a. This will cause the voltage level VsamA1 at R1 a to drop below the level, VoutA1, set at R2 a, which can be detected by comparator 66, as shown in FIG. 5. This change in voltage at R1 a due to current sharing on the bus is used to determine if output driver circuit 60 (i.e., the buffer) is the only device driving the bus. Thus, in FIG. 5, when node gt4 goes high while node gt5 is still low, it indicates that output driver circuit 60 (and thus the buffer) is the only device driving the bus low and the output of the comparator 66 is high. When nodes gt4 and gt5 both go high, it indicates that there is an additional device 80 driving the bus low and the output of comparator 66 goes low.

[0027] While the invention has been described in conjunction with specific embodiments, it is evident that many alternatives, modifications and variations will be apparent to those skilled in the art in light of the foregoing description. Accordingly, it is intended to embrace all such alternatives, modifications and variations as fall within the spirit and scope of the appended claims. 

What is claimed is:
 1. An output driver circuit for connecting to a bus, comprising: a first output driver connected to the bus; a second output driver for generating a reference current; and a comparator, connected to the first and second output drivers, for comparing current flowing through the first output driver with the reference current to determine whether there is an external device driving the bus.
 2. The circuit of claim 1, wherein the first output driver includes a first resistor and a first transistor; and wherein the second output driver includes a second resistor and a second transistor.
 3. The circuit of claim 2, wherein the first resistor is slightly different than the second resistor in value and the first and second transistor are substantially identical.
 4. The circuit of claim 3, wherein the first resistor is slightly larger than the second resistor in value.
 5. The circuit of claim 1, wherein the bus is an I²C bus.
 6. A method, comprising the steps of: connecting a first output driver to a bus; generating a reference current using a second output driver; and comparing, with a comparator, current flowing through the first output driver with the reference current to determine whether there is an external device driving the bus.
 7. The method of claim 6, wherein the first output driver includes a first resistor and a first transistor; and wherein the second output driver includes a second resistor and a second transistor.
 8. The method of claim 7, wherein the first resistor is slightly larger than the second resistor in value and the first and second transistor are substantially identical.
 9. The method of claim 6, wherein the bus is an I²C bus.
 10. An output driver circuit for connecting to a bus, comprising: a parallel circuit including first and second paths, the first path for connecting to the bus; a transistor connected to the parallel circuit in series; and a comparator, connected to first and second paths, for comparing currents flowing through the two paths to determine whether there is an external device driving the bus.
 11. The circuit of claim 10, wherein the first path includes first and second resistors; and wherein the second path includes third and fourth resistors.
 12. The circuit of claim 11, wherein the first path is a low impedance path; wherein the second path is a high impedance path.
 13. The circuit of claim 11, wherein the first, second, third and fourth resistors are scaled such that, when there are no external devices driving the bus, the comparator detects a predetermined difference between the currents flowing through the two paths.
 14. The circuit of claim 10, wherein the bus is an I²C bus.
 15. A method, comprising the steps of: connecting a first path of a parallel circuit to a bus, the parallel circuit also including a second path; connecting a transistor to the parallel circuit in series; and comparing, with a comparator, currents flowing through the two paths to determine whether there is an external device driving the bus.
 16. The method of claim 15, wherein the first path includes first and second resistors; and wherein the second path includes third and fourth resistors.
 17. The method of claim 16, wherein the first path is a low impedance path; wherein the second path is a high impedance path.
 18. The method of claim 16, wherein the first, second, third and fourth resistors are scaled such that, when there are no external devices driving the bus, the comparator detects a predetermined difference between the currents flowing through the two paths.
 19. The method of claim 15, wherein the bus is an I²C bus. 